/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "test")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Test.findAll", query = "SELECT t FROM Test t"),
    @NamedQuery(name = "Test.findByIdtest", query = "SELECT t FROM Test t WHERE t.idtest = :idtest"),
    @NamedQuery(name = "Test.findByName", query = "SELECT t FROM Test t WHERE t.name = :name"),
    @NamedQuery(name = "Test.findByCmnd", query = "SELECT t FROM Test t WHERE t.cmnd = :cmnd"),
    @NamedQuery(name = "Test.findByNgaysinh", query = "SELECT t FROM Test t WHERE t.ngaysinh = :ngaysinh")})
public class Test implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idtest")
    private Integer idtest;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "name")
    private String name;
    @Column(name = "cmnd")
    private Integer cmnd;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ngaysinh")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ngaysinh;

    public Test() {
    }

    public Test(Integer idtest) {
        this.idtest = idtest;
    }

    public Test(Integer idtest, String name, Date ngaysinh) {
        this.idtest = idtest;
        this.name = name;
        this.ngaysinh = ngaysinh;
    }

    public Integer getIdtest() {
        return idtest;
    }

    public void setIdtest(Integer idtest) {
        this.idtest = idtest;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCmnd() {
        return cmnd;
    }

    public void setCmnd(Integer cmnd) {
        this.cmnd = cmnd;
    }

    public Date getNgaysinh() {
        return ngaysinh;
    }

    public void setNgaysinh(Date ngaysinh) {
        this.ngaysinh = ngaysinh;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtest != null ? idtest.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Test)) {
            return false;
        }
        Test other = (Test) object;
        if ((this.idtest == null && other.idtest != null) || (this.idtest != null && !this.idtest.equals(other.idtest))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.Test[ idtest=" + idtest + " ]";
    }
    
}
